package com.example.wechat_b.activity;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.WindowManager;
import android.widget.ListView;
import android.widget.RelativeLayout;

import com.example.wechat_b.R;
import com.example.wechat_b.activity.base.BaseActivity;
import com.example.wechat_b.adapter.FriendQListAdapter;
import com.example.wechat_b.bean.FriendQBean;

import java.util.ArrayList;
import java.util.List;

public class FindActivity extends BaseActivity {

//    private RelativeLayout relativeLayout;
    private ListView listView;
    private List<FriendQBean> beanList;
    private FriendQListAdapter FQAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        //注意要清除 FLAG_TRANSLUCENT_STATUS flag
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().setStatusBarColor(getResources().getColor(R.color.min_gray));
        setContentView(R.layout.activity_find);
        ActionBar bar = getSupportActionBar();
        if (bar.isShowing()) {
            bar.hide();
        }
//        relativeLayout = findViewById(R.id.find_rela);
//        relativeLayout.getBackground().setAlpha(0);

        init();
        //朋友圈数据
        getData();
        initEent();
    }



    private void init() {
        listView = findViewById(R.id.find_list);

        beanList = new ArrayList<>();
    }

    private void initEent() {
        FQAdapter = new FriendQListAdapter(FindActivity.this,beanList);
        listView.setAdapter(FQAdapter);
    }

    private void getData() {
        FriendQBean bean = new FriendQBean();
        bean.setPhoto(R.mipmap.mine);
        bean.setImg(0);
        bean.setName("愿与必成");
        bean.setDescription(getResources().getString(R.string.item6)+"\n 关键字 ："+getResources().getString(R.string.support_key)+getResources().getString(R.string.support_key2));
        bean.setLocal("江西 宜春");
        bean.setTime("今天 11:47");

        FriendQBean bean2 = new FriendQBean();
        bean2.setPhoto(R.mipmap.mine);
        bean2.setImg(0);
        bean2.setName("愿与必成");
        bean2.setDescription(getResources().getString(R.string.item7));
        bean2.setLocal("江西 宜春");
        bean2.setTime("今天 23:20");

        beanList.add(bean);
        beanList.add(bean2);
    }
}